package com.example.test_01.service;

import com.example.test_01.model.Orders;
import com.example.test_01.utils.Result;

import org.litepal.LitePal;

import java.util.List;

public class OrderServiceImpl implements OrderService{
    @Override
    public Result Add(Orders orders) {
        orders.save();
        return Result.SUCCESS;
    }

    @Override
    public Result DelOrderById(int id) {
        LitePal.delete(Orders.class,id);
        return Result.SUCCESS;
    }

    @Override
    public List<Orders> list() {
        List<Orders> list = null;
        list = LitePal.findAll(Orders.class);
        return list;
    }
}
